from flask_restful import fields  # type: ignore

from libs.helper import  TimestampField

prod_tag_fields = {
    "id": fields.String,
    "title": fields.String,
    "shop_id": fields.String,
    "status": fields.Boolean,
    "is_system": fields.Boolean,
    "prod_count": fields.Integer,
    "list_style": fields.Integer,
    "seq": fields.Integer,
    "created_at": TimestampField,
    "updated_at": TimestampField,
    "deleted_at": TimestampField,
}

prod_tag_list_fields={
    "total":fields.Integer,
    "has_more":fields.Boolean,
    "data":fields.List(fields.Nested(prod_tag_fields)),
    "message":fields.String,
}
prod_tag_ref_fields={
    "id": fields.String,
    "tenant_id": fields.String,
    "shop_id": fields.String,
    "tag_id": fields.String,
    "prod_id": fields.String,
    "status": fields.String,
    "created_at": TimestampField,
    "created_by": fields.String,
}

prod_tag_ref_list_fields={
    "total":fields.Integer,
    "has_more":fields.Boolean,
    "data":fields.List(fields.Nested(prod_tag_ref_fields)),
    "message":fields.String,
}
base_prop_value_fields = {
    "prop_id": fields.String,
    "val": fields.String,
}
prod_prop_fields = {
    "id": fields.String,
    "shop_id": fields.String,
    "name": fields.String,
    "is_sale_rule": fields.Boolean,
    "prop_values": fields.List(fields.String),
    "created_at": TimestampField,
    "created_by": fields.String,
}

prod_prop_pagnation_fields = {
    "total":fields.Integer,
    "has_more":fields.Boolean,
    "data":fields.List(fields.Nested(prod_prop_fields))
}
sku_fields={
    "id": fields.String,
    "prod_id": fields.String,
    "properties": fields.Raw,
    "ori_price": fields.Integer,
    "OriPrice": fields.Float,
    "price": fields.Integer,
    "Price": fields.Float,
    "stocks": fields.Integer,
    "actual_stocks": fields.Integer,
    "created_at": TimestampField,
    "updated_a": TimestampField,
    "party_code": fields.String,# 商家编码
    "model_code": fields.String,# 商品条形码
    "pic_file_id": fields.String,
    "PicFileUrl": fields.String,
    "sku_name": fields.String,
    "prod_name": fields.String,# 商品名称
    "weight": fields.Float,# 重量"
    "volume": fields.Float,# 体积
    "status": fields.Boolean,
    "is_deleted": fields.Boolean,
    "created_by": fields.String,
    "updated_by": fields.String,
}

prod_fields={
    "id": fields.String,
    "name": fields.String,
    "shop_id": fields.String,
    "ori_price": fields.Integer,
    "OriPrice": fields.Float,
    "price": fields.Integer,
    "Price": fields.Float,
    "brief": fields.String,
    "content": fields.String,
    "pic_file_id": fields.String,
    "PicFileUrl": fields.String,
    "ImageIds": fields.List(fields.String),
    "ImageUrls": fields.List(fields.String),
    "status": fields.String,
    "category_id": fields.String,
    "sold_num": fields.Integer,
    "total_stocks": fields.Integer,
    "hasUserPickUp": fields.Boolean,
    "hasShopDelivery": fields.Boolean,
    "delivery_template_id": fields.Integer,
    "sku_list": fields.List(fields.Nested(sku_fields)),
    "created_at": TimestampField,
    "created_by": fields.String,
    "updated_at": TimestampField,
    "updated_by": fields.String,
    "putaway_at": TimestampField,
}

prod_list_fields={
    "total":fields.Integer,
    "has_more":fields.Boolean,
    "data":fields.List(fields.Nested(prod_fields)),
    "message":fields.String,
}